
//利用刷新频率计数, 部分显示组件, 来实现白屏优化
export function useDefer(maxFrameCount = 1000) {
    let frameCount = 0
    const refreshFrameCount = () => {
        //显示器刷新频率,自动调用该方法
        requestAnimationFrame(() => {
            frameCount++;
            console.log(frameCount)
            if (frameCount < maxFrameCount) {
                refreshFrameCount()
            }
        })
    }
    refreshFrameCount()
    return function (showInFrameCount) {
        return frameCount >= showInFrameCount
    }
} 